package com.pearl.security.multiloginreject.demo.session.memery;

import jakarta.servlet.http.HttpServletRequest;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.session.SessionInformation;
import org.springframework.security.core.session.SessionRegistry;

import java.util.List;

/**
 * @author TD
 * @version 1.0
 * @date 2024/5/14
 */
public interface IncludeDeviceSessionRegistry extends SessionRegistry {

    /**
     * 获取所有会话
     *
     * @param authentication         认证用户
     * @param request                HttpServletRequest
     * @param includeExpiredSessions 是否包含过期的会话
     * @param differentiateDevice    是否区分设备
     * @return 会话集合
     */
    List<SessionInformation> getAllSessions(Authentication authentication,
                                            HttpServletRequest request,
                                            boolean differentiateDevice,
                                            boolean includeExpiredSessions);
}
